# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=multirun
pkgver=1.0.0
pkgrel=2
pkgdesc="A minimalist init process designed for Docker."
url="https://nicolas-van.github.io/multirun/"
arch="all"
license="MIT"
makedepends="cmake"
checkdepends="bats"
source="$pkgname-$pkgver.tar.gz::https://github.com/nicolas-van/multirun/archive/$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make
}

check() {
	bats tests.bats
}

package() {
	# make DESTDIR="$pkgdir" install # Should be available with next release
	install -m750 -D $pkgname "$pkgdir/usr/bin/$pkgname"
}

sha512sums="4e0987cfeccc6fe2b782271166252c90fb7066e69e7e148bc6e5030a2ba35050790acb9297aa2e4bd319f6ae0ce406fc841dda59b209e4a15d8ec38a121ceffb  multirun-1.0.0.tar.gz"
